package com.probiz.estore.common.model.customer;
/*
 * Model - place business object behaviours here
 *
 */

import com.probiz.estore.common.model.customer.base.MembershipTbl;

public class Membership extends MembershipTbl {

	// 默认会员资格等级
	public static final Integer	MEMBERSHIP_LEVEL_BASE	= Integer.valueOf(1);
	
	private static final long serialVersionUID = -2860590244474235599L;
	/**
	 *
	 * Default Empty Constructor for class Membership
	 *
	 */
	public Membership () {
		super();
	}
	
	public Membership (Integer membershipId, String membershipName) {
		this.membershipId = membershipId;
		this.membershipName = membershipName;
	}
	
	/**
	 *
	 * Default Key Fields Constructor for class Membership
	 *
	 */
	public Membership (
		 Integer in_membershipId
		) {
		super (
		  in_membershipId
		);
	}

	/**
	 * Compare this Membership's level with specified Membership.
	 * @param val
	 * @return -1, 0, or 1 as this level is numerically less than, equal to, or greater than val.
	 */
	public int compareTo(Membership val)
	{
	    return this.getMembershipLevel().compareTo(val.getMembershipLevel());
	}
	/**
	 * 判断是否默认会员等级
	 * @return true 是；  false 否
	 */
	public boolean isBaseMembership() {
		return MEMBERSHIP_LEVEL_BASE.equals(this.getMembershipLevel());
	}
	
}
